<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<title>表单提交-结果页面</title>
</head>

<body>
	<h1>~这是结果页面~</h1>
	<h3>帅锅帅锅你真帅！</h3>
	<h4>大锅大锅欢迎你，感谢你来我这里！</h4>
	<h2>您好，尊敬的用户(这里显示名字)</h2>
	
	<div>
		<button><a href="https:www.baidu.com/">点击跳转</a></button>
		
	</div>
	<script>
		//寻找问号后面的数据全部拿来
		// var url=location.search;
		//解码
			var url=decodeURI(location.search);
			// document.write(url);
			// console.log(url.length);
			function getObj(url){
				//截断
				// let str=url.substr(start,end);
				// let str=url.substr(1);
				// document.write(str);
				let str=url.substr(1).split('&').map(o=>o.split('='));
				// console.log(str);
				let Obj={};
				str.forEach(x=>Obj[x[0]]=x[1])
				// console.log(Obj);
				return Obj;
			};
			
			$(function(){
				var user=url.length ? getObj(url):{}
				$('h2').text('您好,尊敬的用户'+user.name);
			})
			
	</script>
</body>
</html>
